package com.ruoyi.project.emr.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.emr.mapper.EmrDiagnosisMapper;
import com.ruoyi.project.emr.domain.EmrDiagnosis;
import com.ruoyi.project.emr.service.IEmrDiagnosisService;

/**
 * 确诊信息Service业务层处理
 * 
 * @author gzu
 * @date 2023-07-22
 */
@Service
public class EmrDiagnosisServiceImpl implements IEmrDiagnosisService 
{
    @Autowired
    private EmrDiagnosisMapper emrDiagnosisMapper;

    /**
     * 查询确诊信息
     * 
     * @param id 确诊信息主键
     * @return 确诊信息
     */
    @Override
    public EmrDiagnosis selectEmrDiagnosisById(Long id)
    {
        return emrDiagnosisMapper.selectEmrDiagnosisById(id);
    }

    /**
     * 查询确诊信息列表
     * 
     * @param emrDiagnosis 确诊信息
     * @return 确诊信息
     */
    @Override
    public List<EmrDiagnosis> selectEmrDiagnosisList(EmrDiagnosis emrDiagnosis)
    {
        return emrDiagnosisMapper.selectEmrDiagnosisList(emrDiagnosis);
    }

    /**
     * 新增确诊信息
     * 
     * @param emrDiagnosis 确诊信息
     * @return 结果
     */
    @Override
    public int insertEmrDiagnosis(EmrDiagnosis emrDiagnosis)
    {
        emrDiagnosis.setCreateTime(DateUtils.getNowDate());
        return emrDiagnosisMapper.insertEmrDiagnosis(emrDiagnosis);
    }

    /**
     * 修改确诊信息
     * 
     * @param emrDiagnosis 确诊信息
     * @return 结果
     */
    @Override
    public int updateEmrDiagnosis(EmrDiagnosis emrDiagnosis)
    {
        emrDiagnosis.setUpdateTime(DateUtils.getNowDate());
        return emrDiagnosisMapper.updateEmrDiagnosis(emrDiagnosis);
    }

    /**
     * 批量删除确诊信息
     * 
     * @param ids 需要删除的确诊信息主键
     * @return 结果
     */
    @Override
    public int deleteEmrDiagnosisByIds(Long[] ids)
    {
        return emrDiagnosisMapper.deleteEmrDiagnosisByIds(ids);
    }

    /**
     * 删除确诊信息信息
     * 
     * @param id 确诊信息主键
     * @return 结果
     */
    @Override
    public int deleteEmrDiagnosisById(Long id)
    {
        return emrDiagnosisMapper.deleteEmrDiagnosisById(id);
    }
}
